sysctl: make XEN_SYSCTL_topologyinfo sysctl a little more efficient
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Fri, 20 Mar 2015 16:35:39 +0000 (17:35 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 20 Mar 2015 16:35:39 +0000 (17:35 +0100)
commit2090f14c5cbd659c3adebc8cd27d423fae8b6b54
treec2f30ebbd3dec6558d96d471335f236b36d25395
parent4fa6b0bacf9cbd37b67b4895906f9e3b1336a8fc
sysctl: make XEN_SYSCTL_topologyinfo sysctl a little more efficient

A number of changes to XEN_SYSCTL_topologyinfo interface:

* Instead of copying data for each field in xen_sysctl_topologyinfo separately
  put cpu/socket/node into a single structure and do a single copy for each
  processor.
* A NULL cputopo handle passed is a request for maximum number of CPUs
  (num_cpus). If cputopo is valid and num_cpus is smaller than the number of
  CPUs in the system then -ENOBUFS is returned (and correct num_cpus is provided)
* Do not use max_cpu_index, which is almost always used for calculating number
  CPUs (thus requiring adding or subtracting one), replace it with num_cpus.
* There is no need to copy whole op in sysctl to user at the end, we only need
  num_cpus.
* Rename xen_sysctl_topologyinfo and XEN_SYSCTL_topologyinfo to reflect the fact
  that these are used for CPU topology. Subsequent patch will add support for
  PCI topology sysctl.
* Replace INVALID_TOPOLOGY_ID with "XEN_"-prefixed macros for each invalid type
  (core, socket, node).

Update sysctl version to 0x0000000C

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/include/xenctrl.h
tools/libxc/xc_misc.c
tools/libxl/libxl.c
tools/misc/xenpm.c
tools/python/xen/lowlevel/xc/xc.c
xen/common/sysctl.c
xen/include/public/sysctl.h